package cn.com.dhc.mibd.eufw.widget.android.ptr;

import android.content.Context;
import android.util.AttributeSet;
import android.view.MotionEvent;
import android.widget.ListView;

@Deprecated
public class CustomListView extends ListView {

    private MotionEvent lastMotionEvent;

    public CustomListView(Context context) {
        super(context);
    }

    public CustomListView(Context context, AttributeSet attrs) {
        super(context, attrs);
    }

    public CustomListView(Context context, AttributeSet attrs, int defStyle) {
        super(context, attrs, defStyle);
    }

    @Override
    public boolean onInterceptTouchEvent(MotionEvent ev) {
        return false;
    }

    public MotionEvent getLastMotionEvent() {
        return lastMotionEvent;
    }

    @Override
    public boolean dispatchTouchEvent(MotionEvent ev) {
        final int action = ev.getAction();
        if (action == MotionEvent.ACTION_UP) {
            lastMotionEvent = MotionEvent.obtain(ev);
        }

        return super.dispatchTouchEvent(ev);
    }
}